<div class="web-trigger">
	<div class="modal-header">
		<h3 class="modal-title"><i class="fa fa-cog"></i> {{'webTriggerModalHeaderLabel' | translate}}</h3>
	</div>
	<div class="modal-body">
		<p>{{'webTriggerModalDescriptorLabel' | translate}}</p>
		<div class="form-group">
				<strong>{{'Enable' | translate}}</strong> &nbsp;<input ng-change="setWebTriggerStatus(webTriggerEnabled);" ng-model="webTriggerEnabled" type="checkbox">
		</div>
	
		<div ng-if="ccInfo!=null">
			
			<div class="form-group">
				<h5><strong>URL</strong></h5>
				<div>
					<i ng-bind-html="getWebTriggerUrl()"></i>
				</div>
			</div>

			<div class="form-group">
				<h5><strong>{{'authentication'|translate}}</strong></h5>

				<p>
					{{'authenticationHelp'|translate}}
				</p>
				<div>
					<button class='rvd-clickable btn-link' ng-init="showAdvancedAuth=!!ccInfo.accessToken" ng-click="showAdvancedAuth=!showAdvancedAuth">
						<i class="fa fa-gear"> </i> {{'Application-specific token'|translate}}
					</button>
				</div>
				<div ng-show="showAdvancedAuth" class="help-block advanced-form">
					<div class="input-group input-group-sm">
						<span class="input-group-addon">{{'Application access token' | translate}}</span>
						<input ng-model="ccInfo.accessToken" auto-clear type="text" class="form-control mask-invalid" placeholder="alternative authentication disabled">
					</div>
					<div class="help-block">
						<small>{{"alternativeAuthenticationHint" | translate}}</small>
					</div>
					<div ng-show="!!ccInfo.accessToken && ! rvdSettings.apiServerUsername">
						<span class="validation-warning">{{'missingRestcommApiCredentialsWarning'|translate}}</span>
						<div style="font-size: 85%">
							<a target="_blank" href="http://documentation.telestax.com/connect/rvd/Restcomm RVD - Using Web Trigger.html#configure-restcomm-api-credentials">{{'Learn more'|translate}}...</a>
						</div>
					</div>
				</div>
			</div>
			
			
			<div class="form-group">
				<h5><strong>{{'overrideFromTo' | translate}}</strong></h5>
				<p>
					{{'overrideFromTo-help' | translate}}
				</p>
				<div class="row">
					<div class="col-md-6">
						<div class="input-group">
							<span class="input-group-addon">{{'webTriggerModalToInput' | translate}}</span>
							<input ng-model="ccInfo.lanes[0].startPoint.to" type="text" class="form-control">
						</div>
					</div>
					<div class="col-md-6">
						<div class="input-group">
							<span class="input-group-addon">{{'webTriggerModalFromInput' | translate}}</span>
							<input ng-model="ccInfo.lanes[0].startPoint.from" type="text" class="form-control">
						</div>
					</div>

				</div>
				<div class="help-block ">
					<small>
						{{'webTriggerModalFallbackParamHelp6' | translate}} <i>{{'webTriggerModalFallbackParamHelp7' | translate}}</i> {{'webTriggerModalFallbackParamHelp8' | translate}} <i>{{'webTriggerModalFallbackParamHelp9' | translate}}</i> {{'webTriggerModalFallbackParamHelp10' | translate}}
						<code>{{'webTriggerModalFallbackParamHelp11' | translate}}</code> {{'webTriggerModalFallbackParamHelp12' | translate}} <code>{{'webTriggerModalFallbackParamHelp13' | translate}}</code> {{'webTriggerModalFallbackParamHelp14' | translate}} <code>{{'webTriggerModalFallbackParamHelp15' | translate}}</code> {{'webTriggerModalFallbackParamHelp16' | translate}} <code>{{'webTriggerModalFallbackParamHelp17' | translate}}</code>
					</small>
				</div>
			</div>

			<div class="form-group">
				<button ng-init="showAdvanced=!!ccInfo.userParamScope" ng-click="showAdvanced=!showAdvanced" class="btn-link rvd-clickable"><i class="fa fa-gear"></i> {{'Advanced configuration'|translate}}</button>

			</div>
			<div ng-show="showAdvanced" class="form-group">
				<div class="input-group input-group-sm">
					<span class="input-group-addon">{{'User parameter scope'|translate}}</span>
					<select auto-clear ng-model="ccInfo.userParamScope" class="form-control mask-invalid">
						<option value></option>
						<option value="mod">{{'module'|translate}}</option>
						<option value="app">{{'Application'|translate}}</option>
					</select>
				</div>
			</div>
			
		</div>
	</div>
	<div class="modal-footer">
		<div>
			<button id="wt-save-button" class="btn btn-primary" ng-click="save(applicationSid,ccInfo)">{{'webTriggerModalSaveButton' | translate}}</button>
			<button id="wt-cancel-button" class="btn btn-default" ng-click="cancel()">{{'webTriggerModalCancelButton' | translate}}</button>
		</div>
		
	</div>
</div>
